Overall model flow

MtM ABM documentation

Author

David O’Sullivan

Published

February 14, 2025

Date Changes
2025-02-14 Initial post.

Model initialisation

No further detail seems necessary on the initialisation processes. It is worth noting that there are some tricky sequencing issues in the setup which make this code a little ‘fragile’ with some obvious seeming changes for ‘efficiency’ likely to break the model! (These are generally noted in comments.)

flowchart TB
  A((START))
  B[Read land uses<br>and interventions<br>from file]
  C{Geography<br>from GIS<br>files?}
  D[Partition land<br>into farms]
  E[Setup LUC<br>on land]
  F[Read LUC from file]
  G[Read farms from file]
  H[Initialise farmers<br>one per farm]
  I[Partition farms by LUC<br>into holdings]
  J[Initialise market<br>settings from files]
  K[Run one cycle]
  L[Store settings<br>for rapid reset]
  M((END))
  A --> B
  B --> C
  C -->|N| D
  D --> E
  E --> H
  C -->|Y| F
  F --> G
  G --> H
  H --> I
  I --> J
  J --> K
  K --> L
  L --> M

Model main loop

Each model tick the model steps through the sequence shown below.

flowchart TB
  A((START))
  B[Age farmers and<br>replace any that exit]
  C[Update income, costs, and<br>profit of holdings and farms]
  E[Farmer decision making]
  T[Update map and plots]
  Z((END))
  A --> B
  B --> C
  C --> E
  E --> T
  T --> Z